//
// Created by Admin on 2021/9/20.
//
#include "entry.h"
void subject_average(pStudent students,int student_count,int subject_count){
    double* average = calloc(subject_count,sizeof(double ));
    for(int i=0;i<student_count;i++){
        for(int j=0;j<subject_count;j++){
            average[j] += students[i].subjects[j].score;
        }
    }
    for(int j=0;j<subject_count;j++){
        average[j] /= student_count;
        printf("学科%d的平均成绩为：%f\n",j,average[j]);
    }
    free(average);
}